+Thu Jan 22 01:46:45 2004 Jonathan Blandford <jrb@gnome.org>
+
+ * gtk/tmpl/gtktreemodelsort.sgml: new introduction section.
+
2004-01-20 Federico Mena Quintero <federico@ximian.com>
* gtk/gtk-sections.txt: Added gtk_paned_get_child[12].
@Returns:
+<!-- ##### FUNCTION gdk_pixbuf_get_file_info ##### -->
+<para>
+
+</para>
+
+@filename:
+@width:
+@height:
+@Returns:
+
+
@data: user data passed to gdk_pixbuf_save_to_callback().
@Returns: %TRUE if successful, %FALSE (with @error set) if failed.
@Since: 2.4
+
+
+<!-- ##### FUNCTION gdk_pixbuf_save_to_callback ##### -->
+<para>
+
+</para>
+
+@pixbuf:
+@save_func:
+@user_data:
+@type:
+@error:
+@Varargs:
+@Returns:
+
+
+<!-- ##### FUNCTION gdk_pixbuf_save_to_callbackv ##### -->
+<para>
+
+</para>
+
+@pixbuf:
+@save_func:
+@user_data:
+@type:
+@option_keys:
+@option_values:
+@error:
+@Returns:
+
+
+<!-- ##### FUNCTION gdk_pixbuf_save_to_buffer ##### -->
+<para>
+
+</para>
+
+@pixbuf:
+@buffer:
+@buffer_size:
+@type:
+@error:
+@Varargs:
+@Returns:
+
+
+<!-- ##### FUNCTION gdk_pixbuf_save_to_bufferv ##### -->
+<para>
+
+</para>
+
+@pixbuf:
+@buffer:
+@buffer_size:
+@type:
+@option_keys:
+@option_values:
+@error:
+@Returns:
+
+
<para>
</para>
-@gdkpixbufloader:
+@gdkpixbufloader:
<!-- ##### SIGNAL GdkPixbufLoader::area-updated ##### -->
<para>
</para>
-@gdkpixbufloader:
+@gdkpixbufloader:
@arg1:
@arg2:
@arg3:
@load_increment: continues an incremental load.
@load_animation: loads an animation from a file.
@save: saves a #GdkPixbuf to a file.
+@save_to_callback:
<!-- ##### STRUCT GdkPixbufAnimationClass ##### -->
<para>
@msec:
+<!-- ##### FUNCTION gdk_display_set_double_click_distance ##### -->
+<para>
+
+</para>
+
+@display:
+@distance:
+
+
<!-- ##### FUNCTION gdk_display_get_pointer ##### -->
<para>
@height:
+<!-- ##### FUNCTION gdk_display_get_default_group ##### -->
+<para>
+
+</para>
+
+@display:
+@Returns:
+
+
@Returns:
+<!-- ##### FUNCTION gdk_spawn_on_screen ##### -->
+<para>
+
+</para>
+
+@screen:
+@working_directory:
+@argv:
+@envp:
+@flags:
+@child_setup:
+@user_data:
+@child_pid:
+@error:
+@Returns:
+
+
+<!-- ##### FUNCTION gdk_spawn_on_screen_with_pipes ##### -->
+<para>
+
+</para>
+
+@screen:
+@working_directory:
+@argv:
+@envp:
+@flags:
+@child_setup:
+@user_data:
+@child_pid:
+@standard_input:
+@standard_output:
+@standard_error:
+@error:
+@Returns:
+
+
+<!-- ##### FUNCTION gdk_spawn_command_line_on_screen ##### -->
+<para>
+
+</para>
+
+@screen:
+@command_line:
+@error:
+@Returns:
+
+
</para>
+<!-- ##### FUNCTION gdk_threads_set_lock_functions ##### -->
+<para>
+
+</para>
+
+@enter_fn:
+@leave_fn:
+
+
@override_redirect:
+<!-- ##### FUNCTION gdk_window_set_accept_focus ##### -->
+<para>
+
+</para>
+
+@window:
+@accept_focus:
+
+
<!-- ##### FUNCTION gdk_window_add_filter ##### -->
<para>
@leader:
+<!-- ##### FUNCTION gdk_window_get_group ##### -->
+<para>
+
+</para>
+
+@window:
+@Returns:
+
+
<!-- ##### FUNCTION gdk_window_set_decorations ##### -->
<para>
@display:
+<!-- ##### FUNCTION gdk_x11_register_standard_event_type ##### -->
+<para>
+
+</para>
+
+@display:
+@event_base:
+@n_events:
+
+
<!-- ##### FUNCTION gdk_x11_drawable_get_xdisplay ##### -->
<para>
@old_accel_key:
@old_accel_mods:
+<!-- ##### SIGNAL GtkAction::connect-proxy ##### -->
+<para>
+
+</para>
+
+@action: the object which received the signal.
+@widget:
+
+<!-- ##### SIGNAL GtkAction::disconnect-proxy ##### -->
+<para>
+
+</para>
+
+@action: the object which received the signal.
+@widget:
+
<!-- ##### USER_FUNCTION GtkArgGetFunc ##### -->
<para>
Define a function pointer. Deprecated.
@action: the object which received the signal.
-<!-- ##### SIGNAL GtkAction::connect-proxy ##### -->
+<!-- ##### ARG GtkAction:action-group ##### -->
<para>
</para>
-@action: the object which received the signal.
-@widget:
-
-<!-- ##### SIGNAL GtkAction::disconnect-proxy ##### -->
-<para>
-
-</para>
-
-@action: the object which received the signal.
-@widget:
-
<!-- ##### ARG GtkAction:hide-if-empty ##### -->
<para>
</para>
+<!-- ##### ARG GtkAction:visible-horizontal ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkAction:visible-vertical ##### -->
+<para>
+
+</para>
+
+<!-- ##### FUNCTION gtk_action_new ##### -->
+<para>
+
+</para>
+
+@name:
+@label:
+@tooltip:
+@stock_id:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_action_get_name ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gtk_action_is_sensitive ##### -->
+<para>
+
+</para>
+
+@action:
+@Returns:
+
+
+<!-- ##### FUNCTION gtk_action_get_sensitive ##### -->
+<para>
+
+</para>
+
+@action:
+@Returns:
+
+
+<!-- ##### FUNCTION gtk_action_is_visible ##### -->
+<para>
+
+</para>
+
+@action:
+@Returns:
+
+
+<!-- ##### FUNCTION gtk_action_get_visible ##### -->
+<para>
+
+</para>
+
+@action:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_action_activate ##### -->
<para>
</para>
+<!-- ##### SIGNAL GtkActionGroup::connect-proxy ##### -->
+<para>
+
+</para>
+
+@actiongroup: the object which received the signal.
+@arg1:
+@widget:
+
+<!-- ##### SIGNAL GtkActionGroup::disconnect-proxy ##### -->
+<para>
+
+</para>
+
+@actiongroup: the object which received the signal.
+@arg1:
+@widget:
+
+<!-- ##### SIGNAL GtkActionGroup::post-activate ##### -->
+<para>
+
+</para>
+
+@actiongroup: the object which received the signal.
+@arg1:
+
+<!-- ##### SIGNAL GtkActionGroup::pre-activate ##### -->
+<para>
+
+</para>
+
+@actiongroup: the object which received the signal.
+@arg1:
+
<!-- ##### ARG GtkActionGroup:name ##### -->
<para>
</para>
+<!-- ##### ARG GtkActionGroup:sensitive ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkActionGroup:visible ##### -->
+<para>
+
+</para>
+
<!-- ##### FUNCTION gtk_action_group_new ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gtk_action_group_get_sensitive ##### -->
+<para>
+
+</para>
+
+@action_group:
+@Returns:
+
+
+<!-- ##### FUNCTION gtk_action_group_set_sensitive ##### -->
+<para>
+
+</para>
+
+@action_group:
+@sensitive:
+
+
+<!-- ##### FUNCTION gtk_action_group_get_visible ##### -->
+<para>
+
+</para>
+
+@action_group:
+@Returns:
+
+
+<!-- ##### FUNCTION gtk_action_group_set_visible ##### -->
+<para>
+
+</para>
+
+@action_group:
+@visible:
+
+
<!-- ##### FUNCTION gtk_action_group_get_action ##### -->
<para>
@action:
+<!-- ##### FUNCTION gtk_action_group_add_action_with_accel ##### -->
+<para>
+
+</para>
+
+@action_group:
+@action:
+@accelerator:
+
+
<!-- ##### FUNCTION gtk_action_group_remove_action ##### -->
<para>
</para>
+<!-- ##### ARG GtkButton:xalign ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkButton:yalign ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkButton:child-displacement-x ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gtk_button_set_alignment ##### -->
+<para>
+
+</para>
+
+@button:
+@xalign:
+@yalign:
+
+
+<!-- ##### FUNCTION gtk_button_get_alignment ##### -->
+<para>
+
+</para>
+
+@button:
+@xalign:
+@yalign:
+
+
@add_attribute:
@set_cell_data_func:
@clear_attributes:
+@reorder:
<!-- ##### USER_FUNCTION GtkCellLayoutDataFunc ##### -->
<para>
</para>
+<!-- ##### SIGNAL GtkCellRenderer::editing-canceled ##### -->
+<para>
+
+</para>
+
+@cellrenderer: the object which received the signal.
+
<!-- ##### ARG GtkCellRenderer:cell-background ##### -->
<para>
</para>
+<!-- ##### ARG GtkCellRendererText:language ##### -->
+<para>
+
+</para>
+
+<!-- ##### ARG GtkCellRendererText:language-set ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkCellRendererText:markup ##### -->
<para>
</para>
+<!-- ##### ARG GtkCellRendererText:single-paragraph-mode ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkCellRendererText:size ##### -->
<para>
after the menu item is activated.
+<!-- ##### FUNCTION gtk_menu_shell_cancel ##### -->
+<para>
+
+</para>
+
+@menu_shell:
+
+
<!-- ##### ENUM GtkMenuDirectionType ##### -->
<para>
An enumeration representing directional movements within a menu.
@Returns:
+<!-- ##### FUNCTION gtk_message_dialog_set_markup ##### -->
+<para>
+
+</para>
+
+@message_dialog:
+@str:
+
+
@notebook:
@child:
@tab_label:
+@Returns:
<!-- ##### FUNCTION gtk_notebook_append_page_menu ##### -->
@child:
@tab_label:
@menu_label:
+@Returns:
<!-- ##### FUNCTION gtk_notebook_prepend_page ##### -->
@notebook:
@child: the
@tab_label:
+@Returns:
<!-- ##### FUNCTION gtk_notebook_prepend_page_menu ##### -->
@child:
@tab_label:
@menu_label:
+@Returns:
<!-- ##### FUNCTION gtk_notebook_insert_page ##### -->
@child:
@tab_label:
@position:
+@Returns:
<!-- ##### FUNCTION gtk_notebook_insert_page_menu ##### -->
@tab_label:
@menu_label:
@position:
+@Returns:
<!-- ##### FUNCTION gtk_notebook_remove_page ##### -->
@shrink: can this child be made smaller than its requsition.
+<!-- ##### FUNCTION gtk_paned_get_child1 ##### -->
+<para>
+
+</para>
+
+@paned:
+@Returns:
+
+
+<!-- ##### FUNCTION gtk_paned_get_child2 ##### -->
+<para>
+
+</para>
+
+@paned:
+@Returns:
+
+
<!-- ##### MACRO gtk_paned_set_gutter_size ##### -->
<para>
In older versions of GTK+, this function used to set the width of the
@radioaction: the object which received the signal.
@arg1:
+<!-- ##### ARG GtkRadioAction:group ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkRadioAction:value ##### -->
<para>
</para>
+<!-- ##### FUNCTION gtk_radio_action_new ##### -->
+<para>
+
+</para>
+
+@name:
+@label:
+@tooltip:
+@stock_id:
+@value:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_radio_action_get_group ##### -->
<para>
</para>
+<!-- ##### ARG GtkSettings:gtk-double-click-distance ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkSettings:gtk-double-click-time ##### -->
<para>
</para>
+<!-- ##### FUNCTION gtk_toggle_action_new ##### -->
+<para>
+
+</para>
+
+@name:
+@label:
+@tooltip:
+@stock_id:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_toggle_action_toggled ##### -->
<para>
accessed through the function described below.
</para>
+@num_children:
+@children:
+@orientation:
+@style:
+@icon_size:
+@tooltips:
<!-- ##### SIGNAL GtkToolbar::focus-home-or-end ##### -->
<para>
GtkTreeModelSort
<!-- ##### SECTION Short_Description ##### -->
-A wrapper which makes an underlying tree model sortable
+A GtkTreeModel which makes an underlying tree model sortable
<!-- ##### SECTION Long_Description ##### -->
<para>
+The #GtkTreeModelSort is a model which implements the #GtkTreeSortable
+interface. It does not hold any data itself, but rather is created with
+a child model and proxies its data. It has identical column types to
+this child model, and the changes in the child are propagated. The
+primary purpose of this model is to provide a way to sort a different
+model without modifying it.
+</para>
+<para>
+The use of this is best demonstrated through an example. In the
+following sample code we create two #GtkTreeView widgets each with a
+view of the same data. As the model is wrapped here by a
+#GtkTreeModelSort, the two #GtkTreeView<!-- -->s can each sort their
+view of the data without affecting the other. By contrast, if we
+simply put the same model in each widget, then sorting the first would
+sort the second.
+</para>
+<para>
+<example>
+<title>Using a <structname>GtkTreeModelSort</structname></title>
+<programlisting>
+{
+ GtkTreeView *tree_view1;
+ GtkTreeView *tree_view2;
+ GtkTreeModel *sort_model1;
+ GtkTreeModel *sort_model2;
+ GtkTreeModel *child_model;
+
+ /* get the child model */
+ child_model = get_my_model ();
+
+ /* Create the first tree */
+ sort_model1 = gtk_tree_model_sort_new_with_model (child_model);
+ tree_view1 = gtk_tree_view_new_with_model (sort_model1);
+
+ /* Create the second tree */
+ sort_model2 = gtk_tree_model_sort_new_with_model (child_model);
+ tree_view2 = gtk_tree_view_new_with_model (sort_model2);
+
+ /* Now we can sort the two models independently */
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model1),
+ COLUMN_1, GTK_SORT_ASCENDING);
+ gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (sort_model2),
+ COLUMN_1, GTK_SORT_DESCENDING);
+}
+</programlisting>
+</example>
+</para>
+<para>
+To demonstrate how to access the underlying child model from the sort
+model, the next example will be a callback for the #GtkTreeSelection
+"changed" signal. In this callback, we get a string from COLUMN_1 of
+the model. We then modify the string, find the same selected row on the
+child model, and change the row there.
</para>
-<!-- ##### SECTION See_Also ##### -->
<para>
+<example>
+<title>Accessing the child model of in a selection changed callback</title>
+<programlisting>
+void
+selection_changed (GtkTreeSelection *selection, gpointer data)
+{
+ GtkTreeModel *sort_model = NULL;
+ GtkTreeModel *child_model;
+ GtkTreeIter sort_iter;
+ GtkTreeIter child_iter;
+ char *some_data = NULL;
+ char *modified_data;
+
+ /* Get the current selected row and the model. */
+ if (! gtk_tree_selection_get_selected (selection,
+ &sort_model,
+ &sort_iter))
+ return;
+
+
+ /* Look up the current value on the selected row and get a new value
+ * to change it to.
+ */
+ gtk_tree_model_get (GTK_TREE_MODEL (sort_model), &sort_iter,
+ COLUMN_1, &some_data,
+ -1);
+
+ modified_data = change_the_data (some_data);
+ g_free (some_data);
+
+ /* Get an iterator on the child model, instead of the sort model. */
+ gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (sort_model),
+ &child_iter,
+ &sort_iter);
+
+ /* Get the child model and change the value of the row. In this
+ * example, the child model is a GtkListStore. It could be any other
+ * type of model, though.
+ */
+ child_model = gtk_tree_model_sort_get_model (GTK_TREE_MODEL_SORT (sort_model));
+ gtk_list_store_set (GTK_LIST_STORE (child_model), &child_iter,
+ COLUMN_1, &modified_data,
+ -1);
+ g_free (modified_data);
+}
+</programlisting>
+</example>
+</para>
+<!-- ##### SECTION See_Also ##### -->
+<para>
+#GtkTreeModel, #GtkListStore, #GtkTreeStore, #GtkTreeSortable, #GtkTreeModelFilter
</para>
<!-- ##### STRUCT GtkTreeModelSort ##### -->
<para>
-
+This should not be accessed directly. Use the accessor functions below.
</para>
</para>
+<!-- ##### ARG GtkTreeView:fixed-height-mode ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkTreeView:hadjustment ##### -->
<para>
@uimanager: the object which received the signal.
@widget:
+<!-- ##### SIGNAL GtkUIManager::connect-proxy ##### -->
+<para>
+
+</para>
+
+@uimanager: the object which received the signal.
+@arg1:
+@widget:
+
+<!-- ##### SIGNAL GtkUIManager::disconnect-proxy ##### -->
+<para>
+
+</para>
+
+@uimanager: the object which received the signal.
+@arg1:
+@widget:
+
+<!-- ##### SIGNAL GtkUIManager::post-activate ##### -->
+<para>
+
+</para>
+
+@uimanager: the object which received the signal.
+@arg1:
+
+<!-- ##### SIGNAL GtkUIManager::pre-activate ##### -->
+<para>
+
+</para>
+
+@uimanager: the object which received the signal.
+@arg1:
+
<!-- ##### ARG GtkUIManager:add-tearoffs ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gtk_ui_manager_get_toplevels ##### -->
+<para>
+
+</para>
+
+@self:
+@types:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_ui_manager_get_action ##### -->
<para>
@window: the object which received the signal.
@widget:
+<!-- ##### ARG GtkWindow:accept-focus ##### -->
+<para>
+
+</para>
+
<!-- ##### ARG GtkWindow:allow-grow ##### -->
<para>
@setting:
+<!-- ##### FUNCTION gtk_window_set_accept_focus ##### -->
+<para>
+
+</para>
+
+@window:
+@setting:
+
+
<!-- ##### FUNCTION gtk_window_get_decorated ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION gtk_window_get_accept_focus ##### -->
+<para>
+
+</para>
+
+@window:
+@Returns:
+
+
<!-- ##### FUNCTION gtk_window_move ##### -->
<para>
<refsect1>
<title>Overview</title>
<para>
- To create a tree or list in GTK+, you need to use the <link
- linkend="GtkTreeModel">GtkTreeModel</link> interface, in
+ To create a tree or list in GTK+, use the <link
+ linkend="GtkTreeModel">GtkTreeModel</link> interface in
conjunction with the <link
- linkend="GtkTreeView">GtkTreeView</link> widget.
- </para>
- <para>
- This widget is designed around a
- <firstterm>Model/View/Controller</firstterm> design and consists
- of four major parts:
+ linkend="GtkTreeView">GtkTreeView</link> widget. This widget is
+ designed around a <firstterm>Model/View/Controller</firstterm>
+ design and consists of four major parts:
<simplelist>
- <member>the tree view widget (<structname>GtkTreeView</structname>)</member>
- <member>the view column (<structname>GtkTreeViewColumn</structname>)</member>
- <member>the cell renderers (<structname>GtkCellRenderer</structname> etc.)</member>
- <member>and the model interface (<structname>GtkTreeModel</structname>)</member>
+ <member>The tree view widget (<structname>GtkTreeView</structname>)</member>
+ <member>The view column (<structname>GtkTreeViewColumn</structname>)</member>
+ <member>The cell renderers (<structname>GtkCellRenderer</structname> etc.)</member>
+ <member>The model interface (<structname>GtkTreeModel</structname>)</member>
</simplelist>
- The <emphasis>View</emphasis> is composed of the first three,
- while the last is the <emphasis>Model</emphasis>. One of the
- prime benefits of the MVC design is that multiple views can be
- created of a single model. For example, a model mapping the file
- system could be created for a file manager. Many views could be
- created to display various parts of the file system, but only one
- copy need be kept in memory.
+ The <emphasis>View</emphasis> is composed of the first three
+ objects, while the last is the <emphasis>Model</emphasis>. One
+ of the prime benefits of the MVC design is that multiple views
+ can be created of a single model. For example, a model mapping
+ the file system could be created for a file manager. Many views
+ could be created to display various parts of the file system,
+ but only one copy need be kept in memory.
</para>
<para>
The purpose of the cell renderers is to provide extensibility to the
widget and to allow multiple ways of rendering the same type of data.
- For example, consider how to render a boolean variable. Should you
+ For example, consider how to render a boolean variable. Should it
render it as a string of "True" or "False", "On" or "Off", or should
- you render it as a checkbox?
+ it be rendered as a checkbox?
</para>
</refsect1>
<refsect1>
<title>Creating a model</title>
<para>
- GTK+ 2.0 provides two types of models that can be used:
- <link linkend="GtkListStore">GtkListStore</link> and
- <link linkend="GtkTreeStore">GtkTreeStore</link>. GtkListStore is
- used to model columned list widgets, while GtkTreeStore models
- columned tree widgets. It is possible to develop a new type of model,
- but the existing models should be satisfactory for all but the most
- specialized of situations. Creating the model is quite simple:
+ GTK+ provides two simple models that can be used: the <link
+ linkend="GtkListStore">GtkListStore</link> and the <link
+ linkend="GtkTreeStore">GtkTreeStore</link>. GtkListStore is used
+ to model list widgets, while the GtkTreeStore models trees. It
+ is possible to develop a new type of model, but the existing
+ models should be satisfactory for all but the most specialized of
+ situations. Creating the model is quite simple:
</para>
<informalexample><programlisting><![CDATA[
GtkListStore *store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_BOOLEAN);